//
//  CitysController.m
//  QuickCure
//
//  Created by 魏根 on 16/9/13.
//  Copyright © 2016年 haoge. All rights reserved.
//

#import "CitysController.h"

static NSString *reuseID = @"citys";

@interface CitysController ()


@end

@implementation CitysController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:reuseID];
    
    
    
    
}

#pragma mark ---delegate---

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return self.citysArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseID forIndexPath:indexPath];
    
    cell.textLabel.text = self.citysArray[indexPath.row];
    
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
   
    if (self.citysBlock) {
        
        NSString *cityName = [tableView cellForRowAtIndexPath:indexPath].textLabel.text;
        
        self.citysBlock(cityName);
        
    }
    [self.navigationController popToRootViewControllerAnimated:YES];
}



@end
